﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.Paint.DefinePaintBrush.CApBrushData
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using EngineeringInternalExtension;
using EngineeringInternalExtension.DataTypes.Paint;
using System.Collections.ObjectModel;
using System.ComponentModel;
using Tecnomatix.Engineering;


namespace DnProcessSimulateCommands.Paint.DefinePaintBrush;

public class CApBrushData : INotifyPropertyChanged
{
  private ObservableCollection<CApPaintBrush> _paintBrushesList;

  public CApBrushData(TxRobot robot)
  {
    this._paintBrushesList = new ObservableCollection<CApPaintBrush>();
    foreach (TxPaintBrushData brush in TxApplicationEx.PaintManager().GetPaintBrushManager().GetBrushList(robot))
      this._paintBrushesList.Add(new CApPaintBrush()
      {
        BrushId = brush.Id,
        Name = brush.Name,
        Solid = brush.Solid,
        OriginFrame = brush.OriginFrame,
        Robot = robot
      });
  }

  public ObservableCollection<CApPaintBrush> PaintBrushesList
  {
    get => this._paintBrushesList;
    set
    {
      this._paintBrushesList = value;
      this.NotifyPropertyChanged(nameof (PaintBrushesList));
    }
  }

  public event PropertyChangedEventHandler PropertyChanged;

  protected void NotifyPropertyChanged(string propertyName)
  {
    if (this.PropertyChanged == null)
      return;
    this.PropertyChanged((object) this, new PropertyChangedEventArgs(propertyName));
  }
}
